# class 类的定义

# class Car:
#       def __init__(self,a,b)
#           self.color = a
#
#
# #     def run(self, km):
#         print(self.color, '的速度是：', km)
#
#     pass
#
#
# car1 = Car()
# car2 = Car()
#
# # 增加属性
# car1.color = '红色'
# # 删除属性
# # del car1.color
# car1.run(80) 7


# def target(n):
#     data_s = list(n)
#     print(data_s)
#     for mubiao in range(len(data_s) - 1):
#         for mubiao2 in range(mubiao + 1, len(data_s) - 1):
#             if data_s[mubiao] + data_s[mubiao2] == 6:
#                 return mubiao, mubiao2
#
# l1 =
# print(target(l1))

# 类的练习 小狗属性：color,kid,weight, 小狗的方法：eat,info
# class Dog:
#     def __init__(self,a, b, c):
#         self.color = a
#         self.kid = b
#         self.weight = c
#         self.food = []
#     def eat(self, n, food):
#         self.food.append(food)
#         return self.color+'的'+self.kid+','+f'吃了{n}斤{food}，此时体重{self.weight+n}斤'
#     def info(self):
#         s = []
#         for food in
#         return self.color + '的' + self.kid + ',' + f'吃了{n}斤{food}，此时体重{self.weight + n}斤'
#
#
#
# dog1 = Dog('白色', '藏獒', 300)
# dog2 = Dog('黄色', '金毛', 200)
# print(dog1.eat(3,'牛肉'))
# print(dog2.eat(5,'狗粮'))
# print(dog1.info())

# 练习 学生类
# class Student:
#     def __init__(self, name, age, score=0):
#         self.name = name
#         self.age = int(age)
#         self.score = int(score)
#
#
#     def set_score(self, set_score):
#         self.score = int(set_score)
#
#     def show_info(self):
#         return f'姓名：{self.name} 年龄：{self.age} 成绩： {self.score} '
# student_list = []
# student_list.append(Student('尹静娴', 18, 69))
# student1 = Student('尹静娴', 18, 69)
# student2 = Student('吕康', 20, 89)
# student3 = Student('吕婧灵', 13, 99)
# for stu in student_list:
#     stu.show_info()
#
# print(student3.show_info())
#析构方法
#
# class 类:
#     def __del__(self):
# is is not  判断对象是否绑定同一个值，   常用语  验证对象是不是none
# isinstance(xxx, str)  判断对象是不是在某类里面  type
class Dog:
    total_count=0
    total_count += 1
print(Dog.total_count)
dog1 =Dog()
print(dog1.total_count)
dog1.total_count = 999
print(dog1.total_count) #999
print(Dog.total_count) #1



